package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public interface ThirdPartEnum {
    /**
     * 第三方对接appid
     */
    @AllArgsConstructor
    @Getter
    enum ThirdPartCode {
        KUAIMAIERP( "NG951KU6IG", "快麦erp"),
        ;
        private String code;
        private String name;

        /**
         * 根据code判断 是否是枚举中的一员
         * @param code
         * @return
         */
        public static boolean isIncludeCode(String code) {
            ThirdPartEnum.ThirdPartCode t = getCode(code);
            if(null==t) return false;
            return true;
        }

        public static ThirdPartEnum.ThirdPartCode getCode(String code) {
            for (ThirdPartEnum.ThirdPartCode t : ThirdPartEnum.ThirdPartCode.values()) {
                if (t.getCode().equals(code))
                    return t;
            }
            return null;
        }
    }
}
